# Makefile for io processor driver
#
# Author Benedikt Niedermayr (2013)
#
#
# To make this Makefile work on your PC, please choose the correct KDIR Path(Path to the Kernel Sources, for which Kernel you compile the driver)!!
#
#
#
CROSS_COMPILE=arm-linux-gnueabi- 
ARCH=arm


ifneq ($(KERNELRELEASE),)
obj-m	+= io_i2c_interface/io_i2c.o io_gpio_interface/io_gpio.o io_communication_driver/io_core.o io_communication_driver/io_com_OVER_USBSERIAL.o io_communication_driver/io_com_OVER_I2C.o io_communication_driver/io_com_OVER_I2C.o
 
else
KDIR	= /home/brenson/Arbeitsfläche/studium/01-Praktikum/04-ep_develop_kernel-2.6.33/gnublin-develop-kernel/linux-2.6.33-lpc313x
PWD	= $(shell pwd)

default:
	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KDIR) M=$(PWD) modules
endif

clean:
	rm -f modules.order
	rm -f Module.symvers
	rm -rf .tmp_versions/
	rm -f io_i2c_interface/*.ko
	rm -f io_i2c_interface/*.mod*
	rm -f io_i2c_interface/*.cmd*
	rm -f io_i2c_interface/*.o
	rm -rf io_i2c_interface/.tmp_versions
	rm -f io_communication_driver/*.ko
	rm -f io_communication_driver/*.mod*
	rm -f io_communication_driver/*.cmd*
	rm -rf io_communication_driver/.tmp_versions
	rm -f io_communication_driver/*.o
	rm -f io_gpio_interface/*.ko
	rm -f io_gpio_interface/*.mod*
	rm -f io_gpio_interface/*.cmd*
	rm -f io_gpio_interface/*.o
	rm -rf io_gpio_interface/.tmp_versions



